//
//  UIBarButtonItem+Extension.swift
//  WeiBo001
//
//  Created by Zhanghong on 15/6/30.
//  Copyright © 2015年 HeiMa. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    convenience init(imageName: String, hilightedImageName:String?){
        let btn = UIButton()
//        btn.frame = CGRectMake(0, 0, 30, 30)
        btn.setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        let hImageName = hilightedImageName ?? imageName + "_highlighted"
        btn.setImage(UIImage(named: hImageName), forState: UIControlState.Highlighted)
        btn.sizeToFit()
        
        self.init(customView: btn)
//        navigationItem.leftBarButtonItem = UIBarButtonItem(customView: btn)
    }
}
